<?php

// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org 
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------

namespace app\api\model;

use app\common\model\TimeModel;

class Picture extends TimeModel
{
    protected $table = 'ea_mall_picture';
    public function user(){
        return $this->belongsTo(User::class,'user_id', 'id');
    }
    public function like(){
        return $this->hasMany(PictureLike::class, 'pid', 'id');
    }

    public function comment(){
        return $this->hasMany(Comment::class, 'pid', 'id');
    }

    public function picClipboard(){
        return $this->belongsTo(PictureClipboard::class, 'pid', 'id');
    }
    public function picTag(){
        return $this->hasMany(PictureTag::class, 'pid', 'id');
    }
    public function picCollection(){
        return $this->hasMany(PictureCollection::class, 'pid', 'id');
    }
}